package com.sanben.category.controller;


import com.sanben.category.data.req.CategoryReq;
import com.sanben.category.entity.Category;
import com.sanben.category.service.ICategoryService;
import com.sanben.common.web.domain.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cyh
 * @description: 类别分类表 控制器
 * @date: 2020-08-11
 */
@RestController
@RequestMapping("/category")
@Api(tags = "类别分类表相关接口")
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    @GetMapping("/home/list")
    @ApiOperation(value = "首页-分类类别列表", notes = "传入req")
    public Result<List<Category>> getHomeList(CategoryReq req) {
        List<Category> list = categoryService.getHomeList(req);
        return Result.data(list);
    }

}
